feat(docs): publish OpenAPI spec, auth docs and developer portal#638
Conversation
Second pass on agent-readiness (orank 45/100). The remaining Access gaps were all about resources that exist but aren't surfaced on docs.rapidata.ai: - OpenAPI: the API already serves public per-service specs at api.rapidata.ai/<service>/openapi/v1.json. Publish the combined spec at the predictable /openapi.json, rewriting the internal rabbitdata.ch host to the public rapidata.ai one. Every operation already declares its OpenIdConnect scopes, so this also advertises OAuth 2.0 + scoped permissions machine-readably. - Auth: add an Authentication page documenting the real OAuth 2.0 / OIDC client-credentials flow (auth.rapidata.ai), scopes and token endpoint, and link the live discovery document. - Developer portal: add a /developers landing page aggregating the SDK, OpenAPI spec, auth, quickstart, API reference and agent skill. Deliberately not done: OAuth 2.0 is already implemented (not a docs change), so nothing new is "implemented" here — only documented. No fake /.well-known/oauth-authorization-server is served from the docs origin, since that metadata must be served by the issuer (auth.rapidata.ai) to be valid; we link the real openid-configuration instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: lino <lino@rapidata.ai>
Code ReviewThis PR improves docs.rapidata.ai's developer discoverability by publishing a combined OpenAPI spec, adding an authentication guide, and adding a developer portal landing page. The changes are well-scoped and the PR description is honest about what was and wasn't done. A few issues worth addressing: 1. File: The recursive copy brings everything from 2. File:
3. Minified JSON output makes File:
4. Comment and string replacement are misleading — server URL replacement is dead work File: The comment says "rewrite both the server and the OIDC discovery URL" but the servers list is unconditionally overwritten two lines later by Minor notes:
|
The previous cp -R copied all of site_root/ (including the repo-only README.md) then deleted the README afterwards. Switch to an explicit allowlist so repo-only files can never leak onto the published site and no delete is needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: lino <lino@rapidata.ai>
Code ReviewThis PR publishes the combined OpenAPI spec at `/openapi.json`, adds proper OAuth 2.0 / OIDC authentication documentation, and adds a developer portal landing page. The intent and content are solid — a few concrete issues to address before merging. Confirmed bugs1. `cp -R site_root/developers ghpages/developers` nests the directory on every re-deployment `cp -R src dst` when `dst` already exists copies `src` into `dst`, producing `ghpages/developers/developers/index.html` instead of overwriting `ghpages/developers/index.html`. On the second deployment, `git add developers` stages the wrong nested path, the top-level `index.html` is never updated, and the directory grows deeper on every subsequent run. Fix — use the trailing-dot form to always merge-in-place: mkdir -p ghpages/developers
cp -R site_root/developers/. ghpages/developers/Or `rm -rf ghpages/developers` before the copy. 2. `info.setdefault("description", …)` silently keeps the internal description The source spec already has `info.description = "The API for the Rapidata Asset service"`. `setdefault` is a no-op when the key exists, so the public `openapi.json` will publish that internal-facing string instead of the intended public description. The `title` field is correctly overwritten with direct assignment — `description` should be too: info["description"] = (
"Public Rapidata API. Authentication uses OAuth 2.0 (OpenID Connect) — "
"see https://docs.rapidata.ai/latest/authentication/."
)3. `"EntryPoint"` is the wrong JSON-LD property casing in both HTML files JSON-LD is case-sensitive. The Schema.org property is `entryPoint` (lowercase-e); `"EntryPoint"` (uppercase) is treated as an unknown term and silently dropped by every structured-data parser and search-engine crawler. The type value inside (`"@type": "EntryPoint"`) is correct — only the outer key is wrong. // wrong
"EntryPoint": { "@type": "EntryPoint", ... }
// correct
"entryPoint": { "@type": "EntryPoint", ... }Same fix needed in both Notable (worth a comment, not blocking)4. Shell-history exposure of `client_secret` in the curl example The curl snippet passes the secret as a `-d` flag value — which is safe for the HTTP request itself (sent in the POST body, not the URL) but will persist the full command — including any substituted real secret — in the user's shell history. Worth adding a one-liner note: # Tip: use an env var to avoid recording the secret in shell history:
# export RAPIDATA_CLIENT_SECRET=your_secret
# -d "client_secret=$RAPIDATA_CLIENT_SECRET"5. Fragile hostname rewrite via raw string replace Currently safe (exactly 2 occurrences of 6. The "Overview & core concepts" page lost its root-level entry point The `starting_page/` link was removed from the root `index.html`. The page is still reachable through the versioned nav and `llms.txt`, but the new `developers/index.html` — the intended canonical hub — has no link to it either. Adding it under "Guides & examples" would close the gap for non-JS crawlers and AI agents that index from HTML. |
Context
Follow-up to #637, which took docs.rapidata.ai from 15 → 45/100 on orank. This pass addresses the remaining Access gaps — but only the ones that are real and honestly fixable in a docs repo.
Triage of the remaining gaps
/openapi.json/developersaggregator (no fake sandbox)The key realisation: OAuth 2.0, scopes and the OpenAPI specs all already exist and are live.
auth.rapidata.ai/.well-known/openid-configurationreturns the issuer,client_credentialsgrant and scopes;api.rapidata.ai/<service>/openapi/v1.jsonserves public specs. orank reported them missing only because nothing on docs.rapidata.ai pointed to them.Changes
/openapi.json—scripts/build_public_openapi.pytakes the combined spec the SDK is generated from and rewrites the internalrabbitdata.chhost → publicrapidata.ai(2 occurrences; matches whatapi.rapidata.aialready serves). All 264 operations already declareOpenIdConnectscopes, so the published spec advertises OAuth 2.0 and scoped permissions machine-readably. Generated at deploy time so it tracks the repo's CI-updated spec.docs/authentication.md— the real OAuth 2.0 / OIDC client-credentials flow, token endpoint, scopes table, SDK + curl examples, link to the live discovery doc. Added to nav and llms.txt./developers/— a developer-portal landing page aggregating SDK, OpenAPI, auth, quickstart, API reference and the agent skill, withWebAPIJSON-LD.llms.txt/ landing page — now list the OpenAPI spec, auth and developer portal.Deliberately NOT done (to avoid chasing points dishonestly)
/.well-known/oauth-authorization-serveron the docs origin. Per RFC 8414 that metadata must be served by the issuer to be valid; serving a mismatched copy from docs would mislead agents. We link the realopenid-configurationonauth.rapidata.aiinstead. (Optional backend follow-up: the identity service could expose theoauth-authorization-serveralias next to the existingopenid-configuration.)Verification
mkdocs buildpasses with the new page and nav; the generated per-versionllms.txtnow lists Authentication;build_public_openapi.pyproduces a valid 229-path spec with the correct host (0rabbitdatarefs) andOpenIdConnectscheme; YAML and all JSON-LD validated; scriptblack-formatted. Root files take effect on the next Deploy Documentation run.🔗 Session: https://session-b4f9bfe9.poseidon.rapidata.internal/